//
//  ViewController.swift
//  AwesomeUBaseModule
//
//  Created by xieqiang on 04/13/2018.
//  Copyright (c) 2018 xieqiang. All rights reserved.
//

import UIKit
import AwesomeUBaseModule

class ViewController: UIViewController, AUProtocol_Native, AUProtocol_Cache {

    override func viewDidLoad() {
        super.viewDidLoad()
        
        view.backgroundColor = UIColor(au_hexString: "#ff0000", alpha: 100)
        print(view.backgroundColor!.au_toHexString)
        
        print(NSHomeDirectory())
    }
    
    override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
        
//        if au_isCameraEnable(showAlertWhenDenied: true) {
//            print("可用")
//        } else {
//            print("不可用")
//        }
        
        if AUAccountManager.sharedInstance.isLogin {
            print("已经登陆---开始删除---\(AUAccountManager.sharedInstance.accountModel?.userID ?? "")---\(AUAccountManager.sharedInstance.accountModel?.token ?? "")")
            AUAccountManager.sharedInstance.removeAccount()
            print("删除完成")
        } else {
            let userInfo = [
                "userID": "qqqqqq",
                "token": "222222"
            ]
            print("未登录---开始登陆")
            AUAccountManager.sharedInstance.updateAccount(dict: userInfo)
            print("登陆完成---\(AUAccountManager.sharedInstance.accountModel?.userID ?? "")")
        }
        
    }

}

